package org.langqiao.genericity;


public class TestErasure {
	
	public static void main(String[] args) {
		Apple<Integer> a = new Apple<Integer>(6);
		Integer size1 = a.getSize();
		
		Apple b = a; //将a对象赋给b变量时，会丢失尖括号里的信息
		Number size2 = b.getSize();
		System.out.println("size1:"+size1 +",size2:"+size2);
	}

}
class Apple<T extends Number>{
	T size;
	
	public Apple(){	}
	
	public Apple(T size){
		this.size = size;
	}
	
	public void setSize(T size){
		this.size = size;
	}
	
	public T getSize(){
		return size;
	}
}